/////////////////////////////////////////////////////////////////////////////
/*/	
 *	Creator:		Joshua C. Rouzer
 *	Title:			Player Ship Header
 *	Last Edited:	06/14/2013
 *	Summary:		Initialization of player controlled ships
/*/
/////////////////////////////////////////////////////////////////////////////
#ifndef CPLAYSHIP_H
#define CPLAYSHIP_H
#include "movingobject.h"
#include "Crate.h"
#include "Waypoint.h"
class CEmitter;
class CBarricade;
class CSGD_DirectInput;
class CPlayerShip : public CMovingObject{
	CEmitter *m_Emit;
	bool m_bPlayerOne;
	float m_fHealth;
	float m_fTotalHealth;
	float m_fAttackCooldown;
	float m_fSpecialCooldown;
	float m_fAttackWait;
	float m_fSAttackWait;
	float m_fBaseDamage;
	float m_fSpecialDamage;
	unsigned int m_unCredits;
	int m_nSelectedUnit;
	int m_nStarImg;

	/////////////////////////////////////////////////////////////////////////
	// AI VARIABLES & METHODS
	/////////////////////////////////////////////////////////////////////////
	bool IsAi, IsMoving, IsAbducting;
	int targetPath, IsPickingUp;
	float spawnTimer;
	CCrate* AICrate;

	void GetClosestCrate();
	void PickUpCrate(CCrate* i);

	int m_nBulletFire;
	int m_nTractor;
	int m_nDeath;
	int m_nRegen;

	CMovingObject* m_cShip;

	void SpawnUnit(int Path, bool TeamOne, float PosY);
	void GodSpawnUnits( CSGD_DirectInput* pDI );
	bool IsCloseToShip( CMovingObject* OtherShip );
	CMovingObject* IsAboveUnit();
	CWaypoint* IsAboveBuildpoint();
	int m_Units[6];

	//Upgrading functions
	CBarricade* IsAboveBarricade();
	bool IsAboveOwnBase();

public:
	CPlayerShip(bool _playerOne = true, bool _AI = false);
	virtual ~CPlayerShip();
	virtual void Update(float dT);
	virtual void Render();
	bool  operator==		(CPlayerShip &check);
	void  SetHealth			(float fHealth)			{m_fHealth = fHealth;}
	void  SetAttackCool		(float fAttack)			{m_fAttackCooldown = fAttack;}
	void  SetSpecialCool	(float fAttack)			{m_fSpecialCooldown = fAttack;}
	void  SetAttackWait		(float fWait)			{m_fAttackWait = fWait;}
	void  SetSAttackWait	(float fSWait)			{m_fSAttackWait = fSWait;}
	void  SetSpecialDmg		(float fSpecialDmg)		{m_fHealth = fSpecialDmg;}
	void  SetBaseDmg		(float fBaseDmg)		{m_fBaseDamage = fBaseDmg;}
	void  SetCredits		(unsigned int nCredits)	{m_unCredits = nCredits;}
	void  SetShip			(CMovingObject* Ship)	{m_cShip = Ship;}
	void  SetAI				(bool ai)				{IsAi = ai;}
	void  SetIsMoving		(bool tof)				{IsMoving = tof; }
	float GetHealth			()						{return m_fHealth;}
	float GetAttackCool		()						{return m_fAttackCooldown;}
	float GetSpecialCool	()						{return m_fSpecialCooldown;}
	float GetAttackWait		()						{return m_fAttackWait;}
	float GetSAttackWait	()						{return m_fSAttackWait;}
	float GetSpecialDmg		()						{return m_fSpecialDamage;}
	float GetBaseDmg		()						{return m_fBaseDamage;}
	unsigned int GetCredits	()						{return m_unCredits;}
	CMovingObject* GetShip	()						{return m_cShip;}
	int GetSelectedUnit		()						{return m_nSelectedUnit;}
	float GetTotalHealth()							{return m_fTotalHealth;}
	void ThrowDeath();

	int GetDeathSoundID()							{ return m_nDeath;};
};
#endif